package com.cmas.platform.mapper;

import com.aidex.common.core.domain.entity.SysRole;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.cmas.platform.vo.OperatorApplyVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import com.cmas.platform.domain.OperatorApply;

import java.util.List;

/**
 * 运营申请表Mapper接口
 *
 * @author su
 * @email 1218819874@qq.com
 * @date 2024-06-01
 */
@Mapper
public interface OperatorApplyMapper extends BaseMapper<OperatorApply> {

    /**
     * 批量删除运营申请表
     *
     * @param ids 需要删除的运营申请表ID集合
     * @return
     */
    public int deleteOperatorApplyByIds(@Param("ids") String[] ids, @Param("DEL_FLAG_DELETE") String DEL_FLAG_DELETE);

    public List<OperatorApplyVo> selectOperatorApplyVoList(@Param(Constants.WRAPPER)
                                                            QueryWrapper<OperatorApply> setQueryWrapper);

    /**
     * 查询用户角色
     *
     * @param userId
     * @return
     */
    public SysRole selectUserRole(@Param("userId") String userId);

    public SysRole selectRoleByRoleKey(@Param("roleKey") String roleKey);

    public void saveUserRole(@Param("userId") String userId,@Param("roleId") String roleId);


    public  OperatorApply selectLastOperatorApply(@Param("userId") String userId);

}
